package com.doordu.soa.service.web.auth.model;

import com.doordu.soa.service.web.annotation.DataValid;
import com.doordu.soa.service.web.em.RegexType;

import io.swagger.annotations.ApiModelProperty;

/**
 * Token的Model类，可以增加字段提高安全性，例如时间戳、url签名
 * 
 * @ClassName: TokenModel
 * @Description:
 * @author xiaoqun.yi yixq@doordu.com
 * @date 2017年4月6日 上午10:31:43
 * @version V1.0
 */
public class TokenModel {
	// 应用id
	@DataValid(description = "应用ID", maxLength = 500, nullable = false, regexType = RegexType.NO_SPECIALCHAR)
	@ApiModelProperty(value = "应用ID(50)", notes = "应用ID(50)", required = true, dataType = "string")
	private String app_id;

	// 随机生成的uuid
	@DataValid(description = "访问令牌", maxLength = 500, nullable = false, regexType = RegexType.NO_SPECIALCHAR)
	@ApiModelProperty(value = "访问令牌(50)", notes = "访问令牌(50)", required = true, dataType = "string")
	private String access_token;
	
	@ApiModelProperty(hidden = true)
	private Integer companyId;

	@DataValid(description = "过期时间", maxLength = 500, nullable = false, regexType = RegexType.NO_SPECIALCHAR)
	@ApiModelProperty(hidden = true)
	private String expired_at;

	public TokenModel() {

	}

	public TokenModel(String token) {
		this.access_token = token;
	}

	public TokenModel(String appId, String token, Integer companyId) {
		this.app_id = appId;
		this.access_token = token;
		this.companyId = companyId;
	}

	public String getApp_id() {
		return app_id;
	}

	public void setApp_id(String app_id) {
		this.app_id = app_id;
	}

	public String getAccess_token() {
		return access_token;
	}

	public void setAccess_token(String access_token) {
		this.access_token = access_token;
	}

	public String getExpired_at() {
		return expired_at;
	}

	public void setExpired_at(String expired_at) {
		this.expired_at = expired_at;
	}

	public Integer getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}

}
